#import "CYCommon.h"
@implementation CYCommon
SINGLETON_FOR_CLASS(CYCommon)
#define epmayimage [[CYCommon sharedCYCommon] getEpmayImage]
-(UIImage *)getEpmayImage
{
    return IMAGE_NAMED(@"home_female_empty");
}
-(UIImage *)getKatongImageWidthID:(NSString *)uid
{
    if(StrValid(uid))
    {
        NSString *iid = [uid substringFromIndex:uid.length-1];
        return [UIImage imageNamed:NSStringFormat(@"kt%@.jpg",iid)];
    }
    else
    {
        return [UIImage imageNamed:@"kt0.jpg"];
    }
}
-  (UIViewController *)getCurrentVC {
    for (UIWindow *window in [UIApplication sharedApplication].windows.reverseObjectEnumerator) {
        UIView *tempView = window.subviews.lastObject;
        for (UIView *subview in window.subviews.reverseObjectEnumerator) {
            if ([subview isKindOfClass:NSClassFromString(@"UILayoutContainerView")]) {
                tempView = subview;
                break;
            }
        }
        BOOL(^canNext)(UIResponder *) = ^(UIResponder *responder){
            if (![responder isKindOfClass:[UIViewController class]]) {
                return YES;
            } else if ([responder isKindOfClass:[UINavigationController class]]) {
                return YES;
            } else if ([responder isKindOfClass:[UITabBarController class]]) {
                return YES;
            } else if ([responder isKindOfClass:NSClassFromString(@"UIInputWindowController")]) {
                return YES;
            }
            return NO;
        };
        UIResponder *nextResponder = tempView.nextResponder;
        while (canNext(nextResponder)) {
            tempView = tempView.subviews.firstObject;
            if (!tempView) {
                return nil;
            }
            nextResponder = tempView.nextResponder;
        }
        UIViewController *currentVC = (UIViewController *)nextResponder;
        if (currentVC) {
            return currentVC;
        }
    }
    return nil;
}
@end
